import React, { Component } from 'react'
import MyFunctionComponent from './MyFunctionComponent'

class MyClassComponent extends Component {
  state = { count: 0 }
  render() {
    console.log(this.props.name, 'class渲染组件', Date.now())
    return (
      <div>
        {this.props.name}:<button onClick={() => this.setState({ count: this.state.count + 1 })}>add</button>
        {this.state.count}
        <MyFunctionComponent name={'c3'} />
      </div>
    )
  }
}

export default MyClassComponent
